package com.atguigu.spzx.common.service.config;

import com.atguigu.spzx.common.service.interceptro.UserLoginAuthInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName: UserWebMvcConfiguration
 * @Package: com.atguigu.spzx.common.service.config
 * @Description 注册前台用户拦截器
 * @Author 孤妤
 * @Date: 2023/12/19 18:45
 */
@SpringBootConfiguration
public class UserWebMvcConfiguration implements WebMvcConfigurer{
    @Autowired
    private UserLoginAuthInterceptor userLoginAuthInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userLoginAuthInterceptor)
                .addPathPatterns("/api/**");
    }
}
